Closed
Bug 1340083
Opened 8 years ago
Closed 8 years ago
[clang-format] Space should separate braces in empty code
Categories
(Developer Infrastructure :: Source Code Analysis, defect)
Developer Infrastructure
Source Code Analysis
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: jya, Assigned: andi)
References
()
Details
Attachments
(1 file, 1 obsolete file)
5.10 KB,
patch
|
Details | Diff | Splinter Review |
Per coding style rules:
https://developer.mozilla.org/fr/docs/Developer_Guide/Coding_Style#Classes
// Tiny constructors and destructors can be written on a single line.
MyClass() { }
And not:
// Tiny constructors and destructors can be written on a single line.
MyClass() {}
There should be a space for empty bodied code
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → bpostelnicu
Assignee | ||
Comment 1•8 years ago
|
||
I'm looking over this issue but i think this could be simplified a bit.
1. Destructor
For empty body destructors i think the best approach would be to use the default directive
2. Constructor
For empty constructors that don't have neither initialisation list nor body we should also adopt the default directive.
For constructor that only have initialiser list we should use the default brace placement.
Comment hidden (mozreview-request) |
Reporter | ||
Updated•8 years ago
|
Attachment #8845827 -
Attachment is obsolete: true
Attachment #8845827 -
Flags: review?(jwwang)
Reporter | ||
Updated•8 years ago
|
Attachment #8845827 -
Attachment is obsolete: false
Reporter | ||
Updated•8 years ago
|
Attachment #8845827 -
Attachment is obsolete: true
Updated•8 years ago
|
Blocks: clang-format
Assignee | ||
Comment 3•8 years ago
|
||
I've created this patch against clang repo in order to have support for space in empty functions that are not split on two lines.
I've tried it on some files and it produces the desired behaviour.
When you have time please try it and tell me if you think it's OK.
Attachment #8909327 -
Flags: feedback?(jyavenard)
Assignee | ||
Comment 4•8 years ago
|
||
Comment on attachment 8909327 [details] [diff] [review]
patch.diff
I've cancelled the feedback request since I will directly submit this to upstream and I don't want to burden you with the build of clang-tidy.
Attachment #8909327 -
Flags: feedback?(jyavenard) → feedback-
Assignee | ||
Comment 5•8 years ago
|
||
(In reply to Andi-Bogdan Postelnicu [:andi] from comment #4)
> Comment on attachment 8909327 [details] [diff] [review]
> patch.diff
>
> I've cancelled the feedback request since I will directly submit this to
> upstream and I don't want to burden you with the build of clang-tidy.
Minor correct, clang-format not clang-tidy.
Assignee | ||
Updated•8 years ago
|
Assignee | ||
Comment 6•8 years ago
|
||
Has been submitted upstream: https://reviews.llvm.org/D37979
Assignee | ||
Updated•8 years ago
|
Attachment #8909327 -
Flags: feedback-
Assignee | ||
Comment 7•8 years ago
|
||
As per the resolution from https://reviews.llvm.org/D37979, the patch has not been accepted so we must change our coding style i guess.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
Updated•7 years ago
|
Product: Core → Firefox Build System
Updated•3 years ago
|
Product: Firefox Build System → Developer Infrastructure
You need to log in
before you can comment on or make changes to this bug.
Description
•